// 实现await
function run(fn) {
    let gen = fn()
    function _next(val) {
        const [value, done] = gen.next(val);
        if (done) return value;
        if (value.then) {
            return value.then((data)=>_next(data))
        } else {
            _next(value)
        }
    }
    _next()
}